<template>
  <div class="config-manager-page">
    <div class="config-manager-head">
      页面设置
    </div>
    <div class="config-manager-body">
      <div class="page-config">
        <div class="page-config-wp">
          <n-grid x-gap="12" :cols="3">
            <n-gi>
              <div class="wp_item_title">屏幕大小</div>
            </n-gi>
            <n-gi>
              <n-input-number v-model:value="pageConfig.width" size="small"/>
              <div class="wp_item_append">宽度</div>
            </n-gi>
            <n-gi>
              <n-input-number v-model:value="pageConfig.height" size="small"/>
              <div class="wp_item_append">高度</div>
            </n-gi>
          </n-grid>
          <n-grid x-gap="12" :cols="3">
            <n-gi>
              <div class="wp_item_title">背景颜色</div>
            </n-gi>
            <n-gi :span="2">
              <n-color-picker v-model:value="pageConfig.bgColor" size="small"/>
            </n-gi>
          </n-grid>
          <n-grid x-gap="12" :cols="3">
            <n-gi>
              <div class="wp_item_title">背景图</div>
            </n-gi>
            <n-gi :span="2">
              <n-input v-model:value="pageConfig.bgImage" size="small">
                <template #prefix>
                  <i class="iconfont icon-copy_link prexfix_icon"></i>
                </template>
              </n-input>
            </n-gi>
          </n-grid>
        </div>
        <div class="page-config-wp"></div>
        <div class="page-config-wp"></div>
      </div>
    </div>
  </div>
</template>

<script>
import { computed, defineComponent } from "vue";
import { useStore } from "vuex";
// import { NColorPicker, NForm, NFormItem, NGi, NGrid, NInput, NInputNumber } from "naive-ui";

export default defineComponent({
  name: "page-config",
  components: {
    // NForm, NInput, NFormItem, NGrid, NGi, NInputNumber, NColorPicker
  },
  setup() {
    const store = useStore();
    const pageConfig = computed(() => store.state.design.pageConfig);
    return {
      pageConfig
    };
  }
});
</script>

<style lang="less" scoped>
.config-manager-page {
  height: 100%;
  background: #191c21;
  user-select: none;

  .config-manager-head {
    width: 100%;
    height: 30px;
    font-size: 12px;
    line-height: 30px;
    color: #bcc9d4;
    text-align: center;
    background: #2e343c;
    user-select: none;
  }

  .config-manager-body {
    width: 100%;
    height: 100%;
    padding-top: 36px;
    margin-top: -36px;

    .page-config {
      position: relative;
      height: 100%;
      overflow-x: hidden;
      overflow-y: scroll;
      font-size: 12px;
      color: #fff;
      background: #1c2026;

      .page-config-wp {
        position: relative;

        :deep(.n-grid) {
          padding: 4px 4px 4px 8px;

          &:first-child {
            padding-top: 16px;
          }

          .wp_item_title {
            text-align: center;
            height: 28px;
            line-height: 28px;
          }

          .wp_item_append {
            font-size: 12px;
            height: 16px;
            line-height: 16px;
            color: #5c6366;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }

          .prexfix_icon {
            font-size: 12px;
          }
        }
      }
    }
  }
}
</style>